import java.util.*;


public class Peer {
	String ip;
	int port;
	int listen_port;
	List <String>seeds;
	List <String>leeches;

	Peer(String ip, int port){
		this.ip = ip;
		this.port = port;
		seeds= new LinkedList<String> ();
		leeches= new LinkedList<String> ();
	}
	
	Peer(String ip, int port, int listen_port){
		this.ip = ip;
		this.port = port;
		this.listen_port = listen_port;
		seeds= new LinkedList<String> ();
		leeches= new LinkedList<String> ();
	}

	void addLeech(String key){
		if (!leeches.contains(key))
			leeches.add(key);
	}


	void delLeech(String key){
		leeches.remove(key);
	}

	void addSeed(String key){
		if (!seeds.contains(key)){
			seeds.add(key);
		}
	}


	void delSeed(String key){
		seeds.remove(key);
	}

	String getKey(){
		/* String key1 = new String(Integer.toString(ip));
        String key2 = new String(Integer.toString(port));
        key1.concat(key2);*/
		return ip+Integer.toString(port);
	}

	String getPort(){
		return Integer.toString(port);
	}
	
	String getListenPort(){
		return Integer.toString(listen_port);
	}

	String getIp(){
		return ip;
	}
}


